home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20000217-20000824
/
000464_news@columbia.edu _Thu Aug 17 10:42:55 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2000-08-23
|
3KB
Return-Path: <news@columbia.edu>
Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
by uhaligani.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id KAA10475
for <kermit.misc@cpunix.cc.columbia.edu>; Thu, 17 Aug 2000 10:42:55 -0400 (EDT)
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id KAA14155
for <kermit.misc@watsun.cc.columbia.edu>; Thu, 17 Aug 2000 10:42:54 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id KAA16187
for kermit.misc@watsun.cc.columbia.edu; Thu, 17 Aug 2000 10:14:41 -0400 (EDT)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@columbia.edu (Frank da Cruz)
Subject: Re: Newbie question
Date: 17 Aug 2000 14:14:41 GMT
Organization: Columbia University
Message-ID: <8ngs0h$fpp$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <8nfroq$n3l$1@samba.rahul.net>,
Clarence Dold <dold@rahul.net> wrote:
: Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
:
: : Subsequently you found \freplace() (string replacement), not that you need
: : it if you specify break/include sets to \fsplit().
:
: Okay, closer all the time.
: I'm running on Linux at the moment, ckermit 7.0.196.
: The series of logins from a file is working. The desired process is
: working ;-)
:
: Now I'm trying to use the new-found split to get rid of the :23 on the
: vline variable. But I can't figure out how to gracefully discard the
: return from the function.
:
: #!/usr/bin/kermit +
:
: \fsplit(\%1,&a,:,.)
: echo 0 \&a[0]
: echo 1 \&a[1]
: echo 2 \&a[2]
:
: $ onesplit 192.168.1.27:telnet
: ?Not a command or macro name: "2"
: Command stack:
: 1. File : /home/users/cdold/onesplit (line 3)
: 0. Prompt: (top level)
: 0 2
: 1 192.168.1.27
: 2 telnet
:
: It appears that the "count of elements" being returned from fsplit is being
: seen as a command. I could assign it to a variable, or echo it, but I
: don't see how to discard it cleanly.
: freplace isn't the proper tool, since Solaris seems to return :telnet in
: the vline, and Linux returns :23 in the vline. Split would be better.
:
Kermit functions are not commands. All Kermit functions return values
(numbers or strings). It would not make sense to use most functions as
commands (\flength(), \fsubstring(), etc), but I can see your point about
\fsplit(). You can use \fsplit(), or any other function that returns a
number, in any context where you could put a number, like:
#!/usr/bin/kermit +
assert \fsplit(\%1,&a,:,.)
show array a
("show array a" shows the value of each element of array a.)
By the way, \fsplit() has some peculiarities and limitations:
http://www.columbia.edu/kermit/ck70bugs.html
that will be addressed in the next release, which will also include the
reverse function: \fjoin(), which turns an array into a string.
Watch this space for announcements.
- Frank